# 查询数据库，获取MySQL服务器 版本信息
import pymysql

connection = pymysql.connect(host="localhost", port=3306, user="root", passwd="<PASSWORD>",database="test", charset="utf8")
# 获取游标
cursor = connection.cursor()
# 执行语句
cursor.execute("select version();")
# 获取结果
result = cursor.fetchone()
print(result[0])
# 关闭游标
cursor.close()
# 关闭连接
connection.close()

'''
# select * from test_table
# insert into test_table(字段1，字段2) value(值1，值2);
# update test_table set test_field_name = "值";
# delete from test_table where test_field_name = "值1";
'''
